import {getDataByGet} from "../util/getdata.util";
import {DEPARTMENT} from "@/api/api";
import {ElMessage} from "element-plus";

export function getDepartmentList(callback: Function) {
    getDataByGet(DEPARTMENT, null)
        .then((res: any) => {
                if (res.code === 200) {
                    callback(res.datas)
                }
            }
        )
        .catch((err: any) => {
                ElMessage({
                    message: "查询失败",
                    type: "error",
                    duration: 2000
                });
            }
        )
}